= field_set do
  = f.input :name
  = f.input :currency
  = f.input :nature, show: '.{{value}}-options', as: :radio_buttons
  .associate_account-options
    = f.referenced_association :owner
  = f.custom_fields

.bank_account-options
  = field_set(:bank_account) do
    = f.input :bank_account_holder_name
    = f.input :bank_name
    = f.input :bank_agency_address
    = f.input :mode, show: '#{{value}}', as: :radio_buttons

    #iban
      = f.input :iban, input_html: { size: 48 }
      = f.input :bank_identifier_code, input_html: { size: 10 }

    #bban
      = f.input :country
      = f.input :bank_code, input_html: { size: 8 }
      = f.input :bank_agency_code, input_html: { size: 8 }
      = f.input :bank_account_number, input_html: { size: 16 }
      = f.input :bank_account_key, input_html: { size: 4 }

= field_set(:accountancy) do
  = f.referenced_association :main_account, source: :banks_or_cashes_or_associates
  = f.referenced_association :journal, source: { nature: :banks_or_cashes }
  .bank_account-options
    = f.input :suspend_until_reconciliation, show: '.suspend-until-reconciliation'
    .suspend-until-reconciliation
      = f.referenced_association :suspense_account

= f.attachments_field_set
